package org.rc.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.rc.dto.SwResult;

import java.time.LocalDateTime;

@Data
public class ConversationText {
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    private Long conversationId;

    private String text;

    private Integer rl;

    private Integer bg;

    private Integer ed;

    private LocalDateTime createdTime;

    public static ConversationText getInstance(SwResult swResult){
        ConversationText conversationText = new ConversationText();
        conversationText.setText(swResult.getText());
        conversationText.setRl(swResult.getRl());
        conversationText.setBg(swResult.getBg());
        conversationText.setEd(swResult.getEd());
        conversationText.setCreatedTime(LocalDateTime.now());
        return conversationText;
    }

}
